/*
 * FaceDetect.hpp
 *
 *  Created on: Nov 10, 2012
 *      Author: heinstein
 */

#ifndef FACEDETECT_HPP_
#define FACEDETECT_HPP_

#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/contrib/contrib.hpp"
#include "Face.hpp"
#include "FaceList.hpp"

class FaceDetect {
public:
	FaceDetect();
	virtual ~FaceDetect();
	void Detect(void);

private:
	cv::VideoCapture videoStream;
	cv::CascadeClassifier cascade;

	std::vector<FaceList*> inFrame,outOfFrame;
	int uIdCounter;
	double detectionTime;

	Face getFaceRect(cv::Mat *rawFrame, cv::Rect *rect);
	void FaceTrack(std::vector<Face> faces);
	void showFaces(std::vector<FaceList*> faces,cv::Mat rawFrame);
	void showFaces2(std::vector<Face> faces);
	void saveFacesToDisk(std::vector<FaceList*> outOfFrame);

};

#endif /* FACEDETECT_HPP_ */
